//https://leetcode.cn/problems/longest-uncommon-subsequence-ii/submissions/540087751/?envType=daily-question&envId=2024-06-1
bool fun(string& s1, string& s2) {
	size_t i = 0;
	for (size_t j = 0; j < s2.size(); j++) {
		if (s1[i] == s2[j]) {
			i++;
			if (i == s1.size()) {
				//s1是s2的子串
				return true;
			}
		}
	}
	return false;
}
class Solution {
public:
	int findLUSlength(vector<string>& strs) {
		size_t ans = 0;
		for (int i = 0; i < strs.size(); i++) {
			if (strs[i].size() < ans) {
				continue;
			}
			bool tmp = false;
			for (int j = 0; j < strs.size(); j++) {
				if (i!=j && fun(strs[i], strs[j])) {
					//cout << strs[i] << ' ' << strs[j] << '|';
					tmp = true;
					break;
				}
			}
			if (tmp == false) {
				ans = strs[i].size();

			}
		}
		if (ans == 0) {
			return -1;
		}
		return ans;
	}
};
int main() {
	vector<string> ss = { "abc","bcb","cde" };
	Solution().findLUSlength(ss);
}bool fun(string& s1, string& s2) {
	size_t i = 0;
	for (size_t j = 0; j < s2.size(); j++) {
		if (s1[i] == s2[j]) {
			i++;
			if (i == s1.size()) {
				//s1是s2的子串
				return true;
			}
		}
	}
	return false;
}
